// index.js
// 获取应用实例
const app = getApp()

Page({
    data: {
        refreshState: false,
        loading: true,
        loadMoreState: '',
        num: 20,
        pageLoading:true
    },
    onRefresh() {
        const self = this;
        setTimeout(() => {
            self.setData({
                refreshState: false
            })
        }, 3000)
    },
    onLoadMore() {
        let self = this,
            {
                num
            } = self.data;
        setTimeout(() => {
            num += 20;
            self.setData({
                num: num,
                loadMoreState: num < 100 ? '' : 'noMore'
            })
        }, 3000)
    },
    change() {
        this.setData({
            loading: !this.data.loading
        })
    },
    onReady(){
        const self = this;
        setTimeout(() => {
            self.setData({
                pageLoading:false
            })
        },1500)
    }
})